<template>
	<view>
		<view>编号：{{goods['goodsid']}}</view>
		<view>名称：{{goods['goodsname']}}</view>
		<view>类别：{{goods['goodscategory']}}</view>
		<view>规格：{{goods['goodsstandard']}}</view>
		<view>价格：{{goods['goodsprice']}}</view>
		<view class="img-box">
			<view v-if="goods['goodspicture'].length==0">
				<image src="../../../../static/default_goods.png" class="addpic"></image>
			</view>
			<view v-else v-for="img in goods['goodspicture']">
				<image :src="img"></image>
			</view>
		</view>
		<!-- <view>库存：{{goods['goodsstock']}}</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				goods:{
					
				},
				index:-1
			}
		},
		methods: {
			
		},
		onLoad(option) {
			const eventChannel = this.getOpenerEventChannel();
			eventChannel.on('gerGoodsInfo',(data)=>{
				this.goodsid=data.goodsid;
				this.$myRequest({
					url:"/product/get_certain_goods/",
					data:{
						"id":Number(this.goodsid)
					}
				}).then(response=>{
					this.goods=response.data;
				})
			});
		}
	}
</script>

<style>
	.img-box{
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		/* justify-content: space-around; */
		align-items: flex-start;
	}
	.addpic{
	  width: 40px;
	  height: 40px;
	}
	
	.addPics{
	  width: 100%;
	  display: flex;
	  flex-direction: row;
	  white-space: pre-wrap;
	}
</style>
